<template >
  <div class="flex auto" style="padding:20px">
    <!-- 民用 -->
    <span>
      <input type="checkbox" v-model="hinvestigation.plumbing" :false-value='0' :true-value='1'class="magic-checkbox" id="plumbing">
      <label for="plumbing">擅自改动燃气管道及设施
      <span v-if='hinvestigation.plumbing'>**是</span><span v-else>**否</span></label>
    </span><!--  -->
    <span>
      <input type="checkbox" v-model="hinvestigation.accommodate" :false-value='0' :true-value='1'class="magic-checkbox" id="accommodate">
      <label for="accommodate">燃气设施房间内住人
      <span v-if='hinvestigation.accommodate'>**是</span><span v-else>**否</span></label>
    </span><!--  -->
    <span v-show='!usertypestate'>
       <input type="checkbox" v-model="hinvestigation.cookingoil" :false-value='0' :true-value='1'class="magic-checkbox" id="cookingoil">
       <label for="cookingoil">告诉用户应该定期清除厨油污
       <span v-if='hinvestigation.cookingoil'>**是</span><span v-else>**否</span></label>
     </span>  <!-- 非民用 -->
    <span v-show='!usertypestate'>
      <input type="checkbox" v-model="hinvestigation.annunciator" :false-value='0' :true-value='1'class="magic-checkbox" id="annunciator">
      <label for="annunciator">安装燃气泄露报警器
      <span v-if='hinvestigation.annunciator;'>**是</span><span v-else>**否</span></label>
    </span><!-- 非民用 -->
    <span v-show='!usertypestate'>
      <input type="checkbox" v-model="hinvestigation.floodlight" :false-value='0' :true-value='1'class="magic-checkbox" id="floodlight">
      <label for="floodlight">安装防爆照明灯
      <span v-if='hinvestigation.floodlight'>**是</span><span v-else>**否</span></label>
    </span><!-- 非民用 -->
    <span>
       <input type="checkbox" v-model="hinvestigation.groundconnection" :false-value='0' :true-value='1'class="magic-checkbox" id="groundconnection">
       <label for="groundconnection">作为其他电器设备的地接线
       <span v-if='hinvestigation.groundconnection'>**是</span><span v-else>**否</span></label>
     </span>   <!--  -->
    <span>
       <input type="checkbox" v-model="hinvestigation.hitched" :false-value='0' :true-value='1'class="magic-checkbox" id="hitched">
       <label for="hitched">管道及其气表上有物体搭挂
       <span v-if='hinvestigation.hitched'>**是</span><span v-else>**否</span></label>
     </span> <!--  -->
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="hinvestigation.flexiblehose" :false-value='0' :true-value='1'class="magic-checkbox" id="flexiblehose">
      <label for="flexiblehose">连接软管牢固
      <span v-if='hinvestigation.flexiblehose'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="hinvestigation.piplong" :false-value='0' :true-value='1'class="magic-checkbox" id="piplong">
      <label for="piplong">软管长度超过两米
      <span v-if='hinvestigation.piplong'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
       <input type="checkbox" v-model="hinvestigation.yearlong" :false-value='0' :true-value='1'class="magic-checkbox" id="yearlong">
       <label for="yearlong">软管使用超过两年
       <span v-if='hinvestigation.yearlong'>**是</span><span v-else>**否</span></label>
     </span>
    <span v-show='usertypestate'>
       <input type="checkbox" v-model="hinvestigation.changeflexi" :false-value='0' :true-value='1'class="magic-checkbox" id="changeflexi">
       <label for="changeflexi">告知用户更换软管
       <span v-if='hinvestigation.changeflexi'>**是</span><span v-else>**否</span></label>
     </span>
    <span>
       <input type="checkbox" v-model="hinvestigation.pipelinecorrosion" :false-value='0' :true-value='1'class="magic-checkbox" id="pipelinecorrosion">
       <label for="pipelinecorrosion">管道锈蚀
       <span v-if='hinvestigation.pipelinecorrosion'>**是</span><span v-else>**否</span></label>
     </span><!--  -->
    <span v-show='!usertypestate'>
       <input type="checkbox" v-model="hinvestigation.boosterhose" :false-value='0' :true-value='1'class="magic-checkbox" id="boosterhose">
       <label for="boosterhose">告知用户定期更换点火棒胶管
       <span v-if='hinvestigation.boosterhose'>**是</span><span v-else>**否</span></label>
     </span><!-- 非民用 -->
    <span v-show='!usertypestate'>
       <input type="checkbox" v-model="hinvestigation.strongconnection" :false-value='0' :true-value='1'class="magic-checkbox" id="strongconnection">
       <label for="strongconnection">连接牢固
       <span v-if='hinvestigation.strongconnection'>**是</span><span v-else>**否</span></label>
     </span><!-- 非民用 -->
    <span>
      <input type="checkbox" v-model="hinvestigation.hiddendanger" :false-value='0' :true-value='1'class="magic-checkbox" id="hiddendanger">
      <label for="hiddendanger">存在其他安全隐患
      <span v-if='hinvestigation.hiddendanger'>**是</span><span v-else>**否</span></label>
    </span><!--  -->
    <span>
      <input type="checkbox" v-model="hinvestigation.publicitymaterial" :false-value='0' :true-value='1'class="magic-checkbox" id="publicitymaterial">
      <label for="publicitymaterial">发放用户安全宣传资料
      <span v-if='hinvestigation.publicitymaterial'>**是</span><span v-else>**否</span></label>
    </span><!--  -->
    <span>
       <input type="checkbox" v-model="hinvestigation.noticeofrectification" :false-value='0' :true-value='1'class="magic-checkbox" id="noticeofrectification">
       <label for="noticeofrectification">下达隐患整改通知书
       <span v-if='hinvestigation.noticeofrectification'>**是</span><span v-else>**否</span></label>
     </span><!--  -->
    <span>
       通知书编号<input type="text" v-model="hinvestigation.numid" >
     </span><!--  -->
  </div>
</template>

<script>
export default {
  props: ['user'],
  title:'隐患检查',
  data() {
    return {
      model:{},
      usertypestate: false,
      hinvestigation: {
  plumbing: 0,
  accommodate: 0,
  cookingoil: 0,
  annunciator: 0,
  floodlight: 0,
  groundconnection: 0,
  hitched: 0,
  flexiblehose: 0,
  piplong: 0,
  yearlong: 0,
  changeflexi: 0,
  pipelinecorrosion: 0,
  boosterhose: 0,
  strongconnection: 0,
  hiddendanger: 0,
  publicitymaterial: 0,
  noticeofrectificat: 0,
  numid:''
      }
    }
  },
  watch: {
  user:{
      handler:function (val,oldVal) {
          this.model = Object.assign({}, this.model, this.user)
      },
      deep:true
  },
  'model.f_usertype' (val) {
    if (val === '非民用') {
      this.usertypestate = false
    } else {
      this.usertypestate =true
    }
  }
},
ready() {
  this.model = Object.assign({}, this.model, this.user)
}
}
</script>

<style lang="css">
</style>
